<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>性格测试后台管理系统</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <script src="/layui/layui.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <a id="logo" href="/manager/toIndex">
            <div class="layui-logo" style="font-size: x-large;width: 21%">性格测试后台管理系统</div>
        </a>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
<!--                    <img th:src="${user.avatar} " class="layui-nav-img">-->
                    <th:block th:text="${user.userName}"></th:block>
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">基本资料</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="/manager/logout">注销</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">

                <!--左侧动态导航栏-->
                <th:block th:each="firstMenu:${firstMenus}">
                    <li class="layui-nav-item layui-nav-itemed">
                        <a class="" href="#">
                            <span th:text="${firstMenu.menuName}"/>
                        </a>
                        <th:block th:each="secondMenu:${secondMenus}">
                            <th:block th:if="${secondMenu.parentId} eq ${firstMenu.menuId}">
                                <dl class="layui-nav-child">
                                    <dd>
                                        <!-- 此处需要修改数据表中的url地址-->
                                        <a th:href="${secondMenu.url}">
                                            <span style="margin-left: 12px" th:text="${secondMenu.menuName}"/>
                                        </a>
                                    </dd>
                                </dl>
                            </th:block>
                        </th:block>

                    </li>
                </th:block>

            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <iframe id="iframeMain" src="/manager/toIndex" class="layadmin-iframe" frameborder="0"
                style="width: 100%;height: 100%"></iframe>
    </div>

    <div class="layui-footer" style="background-color: #ffffff">
        <!-- 底部固定区域 -->
        ©2759837702@qq.com
    </div>
</div>
<script>
    //JavaScript代码区域
    layui.use(['element', 'jquery', 'layer', 'util'], function () {
        var $ = layui.jquery;
        $(function () {
            //页面加载之后执行的代码
            //点击a标签的时候，修改iframe的src属性
            $("dd>a").click(function (event) {
                //阻断超链接的跳转事件
                event.preventDefault();
                //取得超链接对象的href属性值赋给iframe的src属性
                $("#iframeMain").attr("src", $(this).attr("href"));
            })
            //点击logo到首页
            $("#logo").click(function (event) {
                //阻断超链接的跳转事件
                event.preventDefault();
                $("#iframeMain").attr("src", $(this).attr("href"));
            })
        })

    });
</script>
</body>
</html>